<nav class="navbar navbar-inverse">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/">NodeJS Blog</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <form class="navbar-form navbar-right">
                <% if (!user) { %>
                <a href="/login" type="submit" class="btn btn-success">登录</a>
                <a href="/reg" type="submit" class="btn btn-success">注册</a>
                <% } else { %>
                <a href="" type="submit" class="btn">注销</a>
                <% } %>
            </form>
        </div>
    </div>
</nav>

<% if (success) { %>
<div class="alert alert-success">
    <%= success %>
</div>
<% } %>
<% if (error) { %>
<div class="alert alert-error">
    <%= error %>
</div>
<% } %>